﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;

namespace Ruleweaver.Rules.CheckMethods
{
	public sealed class IsNotNullMethod : CheckMethod
	{
		protected override bool SupportsTargetType(Type targetType)
		{
			return true;
		}

		protected override MethodInfo GetMethod(Type targetType, Type checkType)
		{
			return typeof(Checkable)
				.GetMethods(BindingFlags.Public | BindingFlags.Static)
				.Where(method => method.Name == "IsNotNull")
				.First()
				.MakeGenericMethod(targetType);
		}
	}
}